home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / exceptions.h < prev    next >
C/C++ Source or Header  |  1998-09-15  |  2KB  |  78 lines

  1. /*
  2.  * @(#)exceptions.h    1.11 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. /*
  16.  * The Java runtime exception handling mechanism.
  17.  */
  18.  
  19. #ifndef _EXCEPTIONS_H_
  20. #define _EXCEPTIONS_H_
  21.  
  22. /*
  23.  * Header files.
  24.  */
  25.  
  26. #include "oobj.h"
  27. #include "threads.h"
  28.  
  29. /*
  30.  * Type definitions.
  31.  */
  32.  
  33. /*
  34.  * Exceptions, as defined in the Java93 spec, are subclasses of Object.
  35.  *
  36.  * The list of exceptions thrown by the runtime and other commonly
  37.  * used classes can be found in StandardDefs.gt.
  38.  */
  39. typedef JHandle *exception_t;
  40.  
  41. /*
  42.  * The exception mechanism has a set of preallocated exception objects
  43.  * that can be thrown in the face of utter confusion and system meltdown.
  44.  * internal_exception_t enumerates these objects.
  45.  */
  46. typedef enum {
  47.     IEXC_NONE,                    /* A null object */
  48.     IEXC_NoClassDefinitionFound,
  49.     IEXC_OutOfMemory,
  50.     IEXC_END                    /* Keep this last */
  51. } internal_exception_t;
  52.  
  53.  
  54. /*
  55.  * External routines.
  56.  */
  57.  
  58. /*
  59.  * exceptionInit() -- Initialize the exception subsystem.
  60.  */
  61. extern void exceptionInit(void);
  62.  
  63. /*
  64.  * exceptionInternalObject() -- Return an internal, preallocated
  65.  *    exception object.  These are shared by all threads, so they
  66.  *    should only be used in a last ditch effort.
  67.  */
  68. extern JHandle *exceptionInternalObject(internal_exception_t exc);
  69.  
  70. /*
  71.  * exceptionDescribe() -- Print out a description of a given exception
  72.  *     object.
  73.  */
  74. extern void exceptionDescribe(struct execenv *ee);
  75.  
  76. #endif /* !_EXCEPTIONS_H_ */
  77.  
  78.